Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.FlbDateTimeUtil = exports.DateFormatOption = undefined;
var exp_DateFormatOption = /* */babel_createClass(function n() {
  babel_classCallCheck(this, n);
});
exports.DateFormatOption = exp_DateFormatOption;
var exp_FlbDateTimeUtil = /* */function () {
  function _ctor() {
    babel_classCallCheck(this, _ctor);
  }
  babel_createClass(_ctor, null, [{
    key: "getNowDate",
    value: function getNowDate() {
      console.log(Date.now());
      console.log(new Date().getTime());
      console.log(Date.parse(new Date().toString()));
      console.log(_ctor.getDateTimeStr(Date.now()));
      console.log(_ctor.getStrDate("2022-10-14 18:05:44"));
      console.log(new Date(Date.parse("2022-10-14 18:05:44".replace(/-/g, "/"))));
    }
  }, {
    key: "sjformate",
    value: function sjformate(e) {
      var t = Math.floor(e / 1) % 60 + "";
      parseInt(t) < 10 && (t = "0" + t);
      var a = (e = Math.floor(e / 60)) % 60 + "";
      parseInt(a) < 10 && (a = "0" + a);
      var n = (e = Math.floor(e / 60)) % 24 + "";
      parseInt(n) < 10 && (n = "0" + n);
      var _i9 = (e = Math.floor(e / 24)) + "";
      parseInt(n) < 10 && (_i9 = "0" + _i9);
      return a + ":" + t;
    }
  }, {
    key: "formatDate",
    value: function formatDate(e, t) {
      var a = new exp_DateFormatOption();
      a["M+"] = e.getMonth() + 1;
      a["d+"] = e.getDate();
      a["H+"] = e.getHours();
      a["m+"] = e.getMinutes();
      a["s+"] = e.getSeconds();
      a["q+"] = Math.floor((e.getMonth() + 3) / 3);
      a["S+"] = e.getMilliseconds();
      /(y+)/.test(t) && (t = t.replace(RegExp.$1, (e.getFullYear() + "").substr(4 - RegExp.$1.length)));
      for (var _n25 in a) {
        var _e26 = _n25;
        if (new RegExp("(" + _n25 + ")").test(t)) {
          var _n26 = "";
          for (var _e27 = 0; _e27 < RegExp.$1.length; _e27++) {
            _n26 += "0";
          }
          var _i10 = (_n26 + a[_e26]).substr(("" + a[_e26]).length);
          t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? a[_e26].toString() : _i10);
        }
      }
      return t;
    }
  }, {
    key: "getStrDate",
    value: function getStrDate(e) {
      return new Date(Date.parse(e.replace(/-/g, "/")));
    }
  }, {
    key: "getDate",
    value: function getDate(e) {
      return new Date(e);
    }
  }, {
    key: "getDateTimeStr",
    value: function getDateTimeStr(e, t) {
      var a = this.getDate(e);
      t || (t = "yyyy-MM-dd HH:mm:ss");
      return this.formatDate(a, t);
    }
  }, {
    key: "getDateTimeMsStr",
    value: function getDateTimeMsStr(e) {
      var t = this.getDate(e);
      return this.formatDate(t, "yyyy-MM-dd HH:mm:ss.SSS");
    }
  }, {
    key: "getAge",
    value: function getAge(e) {
      var t = this.getDate(e);
      var a = new Date();
      if (a.getMonth() < t.getMonth() || a.getMonth() == t.getMonth() && a.getDay() < t.getDay()) {
        return a.getFullYear() - t.getFullYear() - 1;
      } else {
        return a.getFullYear() - t.getFullYear();
      }
    }
  }, {
    key: "getBmi",
    value: function getBmi(e, t) {
      return t / Math.pow(e / 100, 2);
    }
  }]);
  return _ctor;
}();
exports.FlbDateTimeUtil = exp_FlbDateTimeUtil;
exp_FlbDateTimeUtil.getNowDate();